clear all
load("p_values_constantUSD.mat")
varall = p_values_constantUSD;

synthetic_average = varall(:, 1); %Synthetic control's average
actual_chile = varall(:, 2); %Synthetic Chile

difference = actual_chile - synthetic_average;

n_years = length(difference);
p_values2 = zeros(1, n_years);

for year = 1:n_years
    % Select data for the current year
    data_year = difference(1:year);
    
    % Perform a one-sample t-test to compare the data to zero
    [~, p_values2(year)] = ttest(data_year);

    % Check if the p-value is less than your chosen significance level (e.g., 0.05)
    significance_level = 0.10; % 90% CI
    if p_values2(year) < significance_level
        fprintf('Year %d: The difference is statistically significantly different from zero (reject null hypothesis).\n', year);
    else
        fprintf('Year %d: The difference is not statistically significantly different from zero (fail to reject null hypothesis).\n', year);
    end
end



